package mil.af.amc.adpetracker.web.actions.struts2.dra;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;
import mil.af.amc.adpetracker.model.DRA;
import mil.af.amc.adpetracker.service.DraService;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author Jason Ferguson
 */
@ParentPackage("json-default")
@Namespace("/dra")
public class DraAction extends ActionSupport implements ModelDriven<DRA>, Preparable {

    private DraService draService;

    @Autowired
    public void setDraService(DraService draService) {
        this.draService = draService;
    }

    // ModelDriven implementation
    private DRA model;

    public DRA getModel() {
        return model;
    }

    private List<DRA> draList;

    // Preparable implementation
    public void prepare() {

    }

    public void prepareExecute() {
        draList = draService.getAll();
    }

    public String execute() {
        throw new UnsupportedOperationException();
    }
    public String viewCreate() {
        throw new UnsupportedOperationException();
    }

    public String create() {
        throw new UnsupportedOperationException();
    }

    public String viewEdit() {
        throw new UnsupportedOperationException();
    }

    public String edit() {
        throw new UnsupportedOperationException();
    }

    public String viewDelete() {
        throw new UnsupportedOperationException();
    }

    public String delete() {
        throw new UnsupportedOperationException();
    }
}
